<%@ page language="java" import="org.apache.commons.lang.StringUtils" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="up7.biz.FolderSchemaDB" %>
<%@ page import="up7.biz.up7_biz_event" %>
<%@ page import="up7.database.sql.SqlFile" %>
<%@ page import="up7.model.FileInf" %>
<%
	out.clear();
	/*
		此页面主要更新文件夹数据表。已上传字段
		更新记录：
			2023-03-07 完善
			2014-07-23 创建
	*/
	String id	= request.getParameter("id");
	String uid	= request.getParameter("uid");
	String cbk 	= request.getParameter("callback");//jsonp
	int ret = 0;

	//参数为空
	if (	!StringUtils.isBlank(id))
	{
		FileInf folder = SqlFile.build().read(id);

		//根节点
		FileInf root = new FileInf();
		root.id = folder.pidRoot;
		root.uid = folder.uid;
		//当前节点是根节点
		if( StringUtils.isBlank(root.id)) root.id = folder.id;

		//从文件中解析层级结构
		FolderSchemaDB scm = new FolderSchemaDB();
		scm.save(folder);

		//上传完毕
		SqlFile.build().complete(id);

		//触发事件
		up7_biz_event.folder_post_complete(id);
		ret = 1;
	}
	out.write(cbk + "(" + ret + ")");
%>